<!-- 个人信息页面顶部组件 -->
<template>
	<div>
		<el-row>
			<el-col :span="24">
				<div class="block demo-basic--circle mains">
					<el-row>
						<el-col :span="1.9" class="school">
							<router-link :to="{name:'userIndex'}" style="color: white;">
								首页
							</router-link>
							&nbsp;|&nbsp;
						</el-col>
						<el-col :span="2" class="school">
							<router-link :to="{name:'userConsumption'}" style="color: white;">
								学生点餐
							</router-link>

						</el-col>
						<el-col :span="17" class="headline">

						</el-col>
						<el-col :span="1.9">
							<el-avatar :size="60" :src="src">
							</el-avatar>
						</el-col>
						<el-col :span="2.5">
							<el-menu  style="border-bottom: 0px;" mode="horizontal"  background-color="#008EE4" text-color="#fff">
								<el-submenu>
									<template slot="title">{{student.name}}</template>
									<el-menu-item index="2-1"  @click="Cook" >
										退出登录
									</el-menu-item>
								</el-submenu>
							</el-menu>
						</el-col>
					</el-row>
				</div>
			</el-col>
		</el-row>
	</div>
</template>

<script>
	import userDataMixin from '../../mixin/userDataMixin'
	import Cookie from 'cookie_js'
	export default {
		mixins: [userDataMixin],
		data() {
			return {
				input: '',
				src: "http://120.79.136.233:9898/queryStudentUserHeadPortraitById/" + localStorage.getItem("userId")
			}
		},
		methods: {
			Cook() {
				//删除cookes 得token
				Cookie.set("token",'')
				// document.cookie = "token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path/login/userLogin;";
				//路由跳转
				this.$router.push({
					name: "userLogin",
				});
			}
		}
	}
</script>

<style scoped>
	.el-col {
		border-radius: 4px;
	}

	.bg-purple-dark {
		background: #0068D7;
	}


	.grid-content {
		border-radius: 4px;
		min-height: 36px;
	}

	.mains {
		background-color: #008EE4;
	}

	.school {
		margin-top: 15px;
		font-size: 25px;
		color: white;
	}


	.headline {
		margin-top: 12px;
		font-size: 25px;
		color: #FFFFFF;
		text-align: center
	}
</style>
